<extend name="common:base" />
<block name="content">
    <div id="header">
        <div class="header">
            <h1 class="tit">{$site_title}</h1>
            <!--<p class="goback">-->
                <!--<a class="return" href="{:U('Customers/index')}">返回</a>-->
            <!--</p>-->
            <!--<p class="more"><a class="share" href=""></a></p>-->
        </div>
    </div>
    <div class="banx-a">
        <!--<form action="{:U('Customers/mem_save')}" method="post" id="mem_save">-->
            <div class="ones">
                <div class="a-a1">
                    <p class="form-p">
                        <span class="fleft form-title">姓名：</span>
                        <input type="text" value="{$member['member_name']}" class="form-text" readonly/>
                    </p>
                    <p class="form-p">
                        <span class="fleft form-title">手机号：</span>
                        <input type="text" value="{$member['mobile']}" class="form-text" readonly/>
                    </p>
                    <p class="form-p">
                        <span class="fleft form-title">微信号：</span>
                        <input type="text" value="{$member['wx']}" class="form-text" readonly/>
                    </p>
                    <p class="form-p">
                        <span class="fleft form-title">地址：</span>
                        <input type="text" value="{$member['address']}" class="form-text" readonly/>
                    </p>
                    <p class="form-p">
                        <span class="fleft form-title">状态：</span>
                        <select class="form-select c_status" name="c_status">
                            <option value="1" <if condition="$member['c_status'] eq 1">selected</if>>未联系</option>
                            <option value="2" <if condition="$member['c_status'] eq 2">selected</if>>已联系</option>
                            <option value="3" <if condition="$member['c_status'] eq 3">selected</if>>已转化</option>
                        </select>
                    </p>
                    <input type="hidden" class="member_id" value="{$member['member_id']}"/>
                    <textarea class="remark remarked" name="remark" placeholder="备注（50字以内）" id="remark">{$member['remark']}</textarea>
                    <textarea class="remark follow" name="follow" placeholder="填写跟进信息（50字以内）" ></textarea>
                </div>
            </div>
            <span class="sub">保存</span>
        <!--</form>-->
        <div class="zongjian">
            <p class="xian"></p>
            <p class="zi">&nbsp;我的跟进记录&nbsp;</p>
            <p class="xian"></p>
        </div>
        <div class="ppp">
            <empty name="$follows">
                <p style="text-align: center">暂无跟进记录</p>
            </empty>
            <foreach name="follows" item="flo">
                <p>
                    {$flo['follow']|mb_substr=0,16,'utf-8'}...
                    <span class="fright">{$flo['f_time']}</span>
                </p>
            </foreach>
        </div>
    </div>
</block>
<block name="CSS">
    <link rel="stylesheet" href="{:C('__STATIC__')}{$theme}/Static/{:C('css')}/khxq.css" />
</block>
<block name="JS">
    <script type="text/javascript">
        $(function(){
            $(".sub").click(function(){
                var remark = $("#remark").val();
                if(!remark){
                    layer.alert("备注必填");
                    return false;
                }
//                console.log($(".follow").val());
//                return false;
                $.ajax({
                    url:"{:U('Customers/mem_view')}",
                    type:"post",
                    data:{
                        member_id:$(".member_id").val(),
                        follow:$(".follow").val(),
                        c_status:$(".c_status").val(),
                        remark:$(".remarked").val()
                    },
                    success:function (msg) {
                        if(msg!=1){
                            layer.msg("保存失败",{icon:2,time:500});
                        }else{
                            layer.msg("保存成功",{icon:1,time:500});
                        }
                        window.location.reload();
                    }
                })
//                $("#mem_save").submit();
            });
        });
    </script>
</block>